package com.anolesoft.yr.mbus.prod.model.service.impl;

import com.anolesoft.yr.mbus.prod.model.mapper.ProdServiceMapper;
import com.anolesoft.yr.mbus.prod.model.service.ProdServiceService;
import com.anolesoft.yr.mbus.prod.model.vo.ProdServiceQueryVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Service
public class ProdServiceServiceImpl implements ProdServiceService {

    @Autowired
    ProdServiceMapper prodServiceMapper;

    //根据主键查询产品服务项名称
    @Override
    public List<ProdServiceQueryVO> queryProdServiceName(String uid) throws Exception {
        List<ProdServiceQueryVO> prodServiceQueryVOList = prodServiceMapper.queryProdServiceNameByUid(uid);
        return prodServiceQueryVOList;
    }

    //根据主键查询服务项唯一数据
    @Override
    public Map<String, Object> queryProdServiceByUid(String uid) throws Exception {
        ProdServiceQueryVO prodServiceQueryVO = prodServiceMapper.queryProdServiceByUid2(uid);

        Map<String, Object> maps = new HashMap<String, Object>();
        maps.put("prodServiceQueryVO", prodServiceQueryVO);
        return maps;
    }

    //查询产品服务项名称
    @Override
    public List<ProdServiceQueryVO> queryProdServiceName2(String prodName) throws Exception {
        List<ProdServiceQueryVO> prodServiceQueryVOList = prodServiceMapper.queryProdServiceName2(prodName);
        return prodServiceQueryVOList;
    }

}
